package com.ruoyi.epidemic.web;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.epidemic.domain.TbDefend;
import com.ruoyi.epidemic.domain.TbPolicy;
import com.ruoyi.epidemic.service.ITbDefendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zyc
 * @createDate 2023/3/21 11:02
 */
@RestController
@RequestMapping("/web/defend")
public class DefendController extends BaseController {

    @Autowired
    private ITbDefendService defendService;

    //应急防护信息列表
    @GetMapping("/list")
    public TableDataInfo getList(@RequestParam(required = false) String title){
        startPage();
        List<TbDefend> list = defendService.getList(title);
        return getDataTable(list);
    }
    //应急防护信息详情
    @GetMapping("/info")
    public AjaxResult getOne(@RequestParam  Long id){
        TbDefend tbDefend = defendService.selectTbDefendById(id);
        return AjaxResult.success(tbDefend);
    }
}
